package com.acme;


public class Test {
	public static void main(String[] args) {
		int v1 = 3;
		byte v2 = v1; // Narrowing primitive conversion int -> byte 
		System.out.println(v2);
		v1 = 256;
		byte v3 = v1; // Narrowing primitive conversion int -> byte
		System.out.println(v3);
		int v4 = 's'; // assigning character`s code to int
		System.out.println(v4);  
		
		byte v5 = 115; // Int to byte, it is narrowing cast
		if (v5 == 's') {
			System.out.println("Equals"); // Every symbol has it's own code
		}
		
		System.out.println((double)4); // Out: 4.0, because double is a type with floating point
		
		double d = 5; // automatic widening convertion in to double
		System.out.println(d + 1); // 6.0 will be print, because we have widening conversion
		
		boolean b = v4; // Not allowed, incompatible types
		
		short v6 = "short"; // Not allowed, incompatible types short and string
		
		float v7 = 3.67; // Default all numbers with floating point are double, so we have double
					     // to float conversion with possible precision loss
		
		float v9 = 3;// We have no compilation error here because float and int have similar size
					 // (32 bits) and float has higher precision than int, so it is widening cast
		
		int v8 = v7;// Narrowing primitive conversion, float has higher precision than int

		int array[] = new double["27"];// Size of array have to be an int value , not string
		
	}
}
